package admin.server.exception;

import admin.common.enums.ResponseEnum;

/**
 * 自定义API异常
 * Created by zgb on 2020/2/27.
 */
public class ApiException extends RuntimeException {
    private ResponseEnum responseEnum;

    public ApiException(ResponseEnum responseEnum) {
        super(responseEnum.getMsg());
        this.responseEnum = responseEnum;
    }

    public ApiException(String message) {
        super(message);
    }

    public ApiException(Throwable cause) {
        super(cause);
    }

    public ApiException(String message, Throwable cause) {
        super(message, cause);
    }

    public ResponseEnum getErrorCode() {
        return responseEnum;
    }
}
